﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
namespace WindowsFormsApplication2
{[Serializable]
    public class Shape
    {
        private Point ptShape;

        public Point PointShape
        {
            get { return ptShape; }
            set { ptShape = value; }
        }
      
        private DashStyle penStyle;

        public DashStyle PenStyle
        {
            get { return penStyle; }
            set { penStyle = value; }
        }
        private Color penColor;

        public Color PenColor
        {
            get { return penColor; }
            set { penColor = value; }
        }
       
        public int FontSize
        {
            get;
            set;
        }
        public int ShapeWidth
        {
            get;
            set;
        }
        public int PenWidth
        {
            get;
            set;
        }
        private Color shapeFont;

        public Color ShapeFont
        {
            get { return shapeFont; }
            set { shapeFont = value; }
        }
        public Shape(Point pointShape)// Ham tao gia tri ban dau cho shape
        {
            PointShape = pointShape;
            PenStyle = DashStyle.Dash;
            PenColor = Color.Blue;
           
            FontSize = 21;
            PenWidth = 3;
            ShapeFont = Color.Green;
            

            ShapeWidth = 100;

        }
        public void DrawString(Graphics g,string s)
        {
           
           
            //Tao brush to hinh 
            GraphicsPath gr=new GraphicsPath();
            gr.AddString(s, new FontFamily("Arial"), (int)FontStyle.Italic, FontSize, PointShape, StringFormat.GenericDefault);
            Brush brush = new SolidBrush(ShapeFont);
            Pen pen = new Pen(penColor, PenWidth);
            pen.DashStyle = PenStyle;
            // To hinh 
           // g.DrawString(s, fontShape, brush, xmin,ymin);
            g.FillPath(brush, gr);
            g.DrawPath(pen, gr);
        
         
        }
            
    }//Shape
}
